package cn.com.ejiakanghu.service;

import com.github.pagehelper.PageHelper;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.dao.divided.AgedmallInfoPromoteUserSettlementMapper;
import org.linlinjava.litemall.db.domain.AgedmallPromoteWithdrawalRecord;
import org.linlinjava.litemall.db.vo.app.AgedmallPromoteUserSettlementDto;
import org.linlinjava.litemall.db.vo.app.DiviedQuery;
import org.linlinjava.litemall.db.vo.app.OrderSumMoneryDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author huangfei
 * @create 2021-12-30 13:42
 */
@Service
public class AgedmallPromoteUserSettlementService {

    @Resource
    private AgedmallInfoPromoteUserSettlementMapper userSettlementMapper;
    /**
     * 查询分成信息
     * @param diviedQuery
     * @return
     */
   public List<AgedmallPromoteUserSettlementDto> getPromoteUserSettleMent(DiviedQuery diviedQuery){
       PageHelper.startPage(diviedQuery.getPage(), diviedQuery.getPageSize());
       return userSettlementMapper.getPromoteUserSettleMent(diviedQuery);
   }

    /**
     * 查询提现信息
     * @param page
     * @param pageSize
     * @return
     */
   public List<AgedmallPromoteWithdrawalRecord> getWithdrawalRecodrInfo(Integer page, Integer pageSize){
       PageHelper.startPage(page, pageSize);
       return userSettlementMapper.getWithdrawalRecodrInfo();
   }

    /**
     * 统计订单总金额(包括服务订单)
     * @param childOrderCode
     * @return
     */
    public OrderSumMoneryDto getOrderSumMoney(@Param("childOrderCode") String childOrderCode){
        return  userSettlementMapper.getOrderSumMoney(childOrderCode);
    }

}
